package com.lltt.study.controller;

import cn.hutool.core.date.DateUtil;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.deepseek.DeepSeekChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class DeepSeekController {
    @Resource
    private DeepSeekChatModel deepSeekChatModel;
    @GetMapping("/chat")
    public String chat(@RequestParam(value = "question",defaultValue = "你是谁")String question){
        String result = deepSeekChatModel.call(question);
        System.out.println("result = " + result);
        return DateUtil.now() + result;
    }
}
